//
//  PCInpourManager.m
//  PromotionCode
//
//  Created by uuu9 on 2017/11/28.
//  Copyright © 2017年 My. All rights reserved.
//

#import "PCInpourManager.h"
#import "PCInpourModel.h"
#import "PCWXInpourModel.h"
@implementation PCInpourManager


+(void)aLiPayWithMoney:(NSDecimalNumber *)money UserID:(NSString *)uid andSessionID:(NSString *)sessionid andCompletionHandle:(void (^)(InpourModel *, NSError *))complete{
    [self EncryptPOST:[NSString stringWithFormat:@"%@%@",Api_URL,kALiPayInpour]
   parameters:[NSString stringWithFormat:@"userid=%@&money=%@&sessionid=%@",uid,money,sessionid]
completionHandler:^(id responseObj, NSError *error) {
    PCInpourModel *model = [PCInpourModel mj_objectWithKeyValues:responseObj];
    if (model.error_code != 0) {
        error = [self createError:model.error_msg];
    }
    complete(model.output,error);
}];
    
}

+(void)wxPayWithMoney:(NSDecimalNumber *)money UserID:(NSString *)uid andSessionID:(NSString *)sessionid andCompletionHandle:(void (^)(WXInpourModel *, NSError *))complete{
    [self EncryptPOST:[NSString stringWithFormat:@"%@%@",Api_URL,kWXPayInpour]
           parameters:[NSString stringWithFormat:@"userid=%@&money=%@&sessionid=%@",uid,money,sessionid]
    completionHandler:^(id responseObj, NSError *error) {
        PCWXInpourModel *model = [PCWXInpourModel mj_objectWithKeyValues:responseObj];
        if (model.error_code != 0) {
            error = [self createError:model.error_msg];
        }
        complete(model.output,error);
    }];
    
}
@end
